
import task from "../../../models/dict/task.js"  //任务字典模块
import clType from "../../../models/dict/clothesSizeType"  //任务字典模块
import array from "../../../models/comm/array.js"  //数组操作模块

import dCustomerOrder from '../../../models/dict/customerOrder';
import py from '../../../models/comm/webPy';
import axios from 'axios';
import Vue from 'vue'

const dataShow = require('./dataShow.vue');


export default {


    data: function () {


        return {
            currObj: {

                name: ""
            },
            Loading: true,


        }
    },

    methods: {

        getSalesMembers(salesMembers) {
            return dCustomerOrder.getSalesMembers(salesMembers)

        },
        getCustomerOrder() {
            if (this.customerOrderId) {

                this.Loading = true;

                axios.post("/a", {
                    class: "customerOrder",
                    para: "getCustomerOrder",
                    j: {
                        _id: this.customerOrderId
                    }

                }).then((res) => {



                    if (this.dataType) {

                        if (this.dataType == "proof") {
                            res.data.info.openBulk = false
                        }
                        else if (this.dataType == "bulk") {
                            res.data.info.openProof = false
                        }


                    } else {

                    }

                    this.currObj = dCustomerOrder.fmtCustomerOrder(res.data.info);
                    this.Loading = false

                });



            }



        },
        getClassName() {


            return clType.getClassName(this.currObj.classId)
        }



    },
    props: [

        "customerOrderId",

        "dataType"


    ],
    mounted() {
        this.getCustomerOrder();
    },
    watch: {
        customerOrderId: function (params) {
            this.Loading = true
            this.getCustomerOrder()
        }
    },
    components: {
        dataShow
    }

};